#ifndef __PLAYERPERFORMANCE_H__
#define __PLAYERPERFORMANCE_H__

#include "cocos2d.h"

using namespace cocos2d;

class PlayerPerformance
{
private:

	// Equation for Alive Duration: y = ke^x + c
	// Increasing at increasing rate
	float 				_varK,
						_varC,
						_varGameK,
						_varGameC;

	bool				_isDamaged;			// check if character is damaged

	float				_totalGameDuration, // total game duration in minutes
						_gameDuration,		// current duration of the game
						_aliveDuration;		// how long has the character stayed alive, to convert to minutes

	//===== FUNCTIONS =====
	void		setEquationVariable();			// Set variable K and C for the equation
	void		setGameEquationVariable();		// Set variable K and C for the equation
	int			getAliveDurationDiff();			// Get difficulty level based on how long character has survived
	int			getGameDurationDiff();			// Get difficulty level based on how game length

public:

	//===== CONSTRUCTOR =====
	PlayerPerformance( int totalGameDuration ); 	//Default constructor

	//===== DESTRUCTOR =====
	~PlayerPerformance(void);

	//===== FUNCTIONS =====
	void		update(float timeDiff);				// Update the info for player's performance
	void		reduceDifficulty();					// Character has died, reset alive duration
	bool		isDifficultyReduced();

	//===== GETTERS =====
	float		getGameDuration() {		return _gameDuration; 		}
	float		getAliveDuration() {	return _aliveDuration/60.0; }	// Convert to minutes

	int			getPerformanceLevel();
};

#endif // __PLAYERPERFORMANCE_H__
